import {
    CORE_GROUP_ADD,
    CORE_GROUP_DELETE,
    CORE_GROUP_LIST,
    CORE_GROUP_UPDATE
} from '@/config/api'
import {
    ICoreGroup,
    ICoreGroupDeleteParameter,
    ICoreGroupEditParameter,
    ICoreGroupListParameter
} from '@/types/core/group'
import http from '@/utils/http'

export function coreGroupList(parameter: ICoreGroupListParameter) {
    return http.get<ICoreGroup[]>(CORE_GROUP_LIST, parameter)
}

export function coreGroupAdd(parameter: ICoreGroupEditParameter) {
    return http.post(CORE_GROUP_ADD, parameter)
}

export function coreGroupUpdate(parameter: ICoreGroupEditParameter) {
    return http.post(CORE_GROUP_UPDATE, parameter)
}

export function coreGroupDelete(parameter: ICoreGroupDeleteParameter) {
    return http.post(CORE_GROUP_DELETE, parameter)
}
